import java.util.Random;

public class Inserta {
	public static void main(String[] args) {
		Random random=new Random();
		int[] a=new int[10];
		
		for (int i = 0; i < a.length; i++) {
			a[i]=random.nextInt(10);
			
		}
		for (int i = 0; i < a.length; i++) {
			for(int j=i ;j>0;j--){
				if(a[j]<a[j-1]){
					int temp=a[j-1];
					a[j-1]=a[j];
					a[j]=temp;
				}
				else
					break;
			}	
		}
        for (int i = 0; i < a.length; i++) {
			System.out.print(a[i]+",");
		}
        System.out.println("\n"+"------------------");
        for(Integer b:a){
        	System.out.print(b+",");
        }

		
	}

}
